import React, { Component } from 'react'

import { generateRandomString } from '../../utils';
import style from './index.module.css'

export default class TodoItem extends Component {
  render() {
    const { checked, value, id } = this.props;

    return (
      <div className={style.item}>
        <input
          type="checkbox"
          checked={checked}
          onChange={e => this.props.handleChange({ id, value, checked: e.target.checked })}
        />
        <span className={style.value}>{value}</span>
      </div>
    )
  }
}
